import Vue from "vue";
import Router from 'vue-router'
Vue.use(Router);
import Home from '../views/Home/home'
import Index from '../views/Index/index'
import Recommend from '../views/Recommend/recommend'
import Search from '../views/Search/search'
import ShoppingCart from '../views/ShoppingCart/shoppingCart'
import My from '../views/My/my'

export default new Router({
    routes:[
        {
            path:'/',
            name:'Home',
            component:Home,
            redirect:'/index',
            children:[
                {
                    //首页
                    path:'/index',
                    name:'Index',
                    component:Index,
                },
                {
                    // 推荐
                    path:'/recommend',
                    name:'Recommend',
                    component:Recommend,
                },
                {
                    //搜索
                    path:'/search',
                    name:'Search',
                    component:Search,
                },
                {
                    // 购物车
                    path:'/shoppingCart',
                    name:'ShoppingCart',
                    component:ShoppingCart,
                },
                {
                    // 我的
                    path:'/my',
                    name:'My',
                    component:My,
                }
            ]
        }
    ]
})